--Handles EMPs and other objects that disable a system
--Using tables to allow multiple systems to be disabled at once
local priority = 7

EntitySystem.updatesystem("disableSystem", priority, function(dt)
  for e in pairs(EntitySystem.query("isDisabled")) do
    --Track Player disabled
    if e.disableTP then
      if e.disableTP.timer >= e.disableTP.duration then
        EntitySystem.attach(e, 'trackPlayer')
        EntitySystem.detach(e, 'disableTP')
      else
        e.disableTP.timer = e.disableTP.timer + dt
      end
      
    end
  end
end)